package com.liao.dao;

import com.liao.entity.Top10Category;
import com.liao.entity.Top10Patient;
import com.liao.util.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class Top10PatientDaoImpl {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());

    public List<Top10Patient> findAll() {
        String sql = " select * from top10_patient";
        return template.query(sql, new BeanPropertyRowMapper<Top10Patient>(Top10Patient.class));
    }
}
